package com.myblog.service;

import com.myblog.model.User;
import com.myblog.utils.DataMap;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;

public interface UserService {
    DataMap register(User user);

    boolean userNameIsExist(String username);

    DataMap ifHavePermission(Integer id);

    User searchUserByPhone(String phone);

    DataMap getUserPersonInfo(String username);

    DataMap sendCode(String phone, HttpSession session);

    DataMap changePhoneAndPassword(String phone, String newPassword, Integer id, String code, HttpSession session);

    DataMap saveUserByUserPhone(String name, User user);

    DataMap changeUserImgByUsername(User user, MultipartFile img);

    DataMap forgetChangePhoneAndPassword(String phone, String newPassword, HttpSession session);

    User searchUserByName(String name);

    DataMap saveUserByUserName(String name, User user);

    DataMap changePhoneByOldPhone(String phone, String newPhone, Integer id, String authCode, HttpSession session);
}
